import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
// import java.util.Date;
import java.io.PrintWriter;
import java.util.Date;

public class Ranking extends Pergunta {
        private String fileName = "as\\ranking.txt";
        private String[] x;
        public Ranking() throws FileNotFoundException, IOException {
                super();
                x= selecionarALL(fileName);

                
        }
        
        public void saveFileRanking() throws IOException {
                int x = pontuacaoTotal();
                Date data = new Date();
                try {     
                        FileOutputStream out = new FileOutputStream(fileName, true);              
                    PrintStream p = new PrintStream(out);
                    p.print(Integer.toString(x)+" "+data+";"+'\n');
                   // p.write(x+'\n');            
                    p.close();                               
                }  
                catch(Exception e) {  
                    System.err.println(e);  
                }     
              }                 

        private String[] imprimirFile() throws FileNotFoundException, IOException {
                return selecionarALL(fileName);
        }

        
}
